import { Component, OnInit, Input, Inject, Output, EventEmitter } from '@angular/core';
import { API_CONFIG } from 'src/app/service/service.module';
@Component({
  selector: 'app-static-editor',
  templateUrl: './static-editor.component.html',
  styleUrls: ['../../editor.less']
})
export class StaticEditorComponent implements OnInit {
  @Input() selectEl = {
    type: 'static',
    text: ''
  }
  imgCataLog = ``
  @Output() onRemove = new EventEmitter(null)
  @Output() onSave = new EventEmitter(null)
  constructor( @Inject(API_CONFIG) private uri: string,) { }

  ngOnInit(): void {
    this.imgCataLog = this.uri + '/custom/upload/live-cover';
  }
  save() {
    this.onSave.emit()
  }
  remove(){
    this.onRemove.emit()
  }
  outputData(e){
    this.selectEl.text=e
    this.save()
  }
}
